﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>系统首页</title>
    <!-- Bootstrap Styles-->
    <link href="../assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="../assets/css/font-awesome.css" rel="stylesheet" />
    <!-- Morris Chart Styles-->
    <link href="../assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="../assets/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
    <!-- 自定义样式文件 -->
    <link href="../assets/css/dhg-styles.css" rel="stylesheet" />
</head>
<style>

</style>
<body>
    <div id="wrapper">
        <nav class="navbar navbar-default top-navbar" role="navigation">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.html">邻里农园后台管理系统</a>
            </div>

            <ul class="nav navbar-top-links navbar-right">
                <!-- /.dropdown -->
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
                        <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a href="#"><i class="fa fa-user fa-fw"></i> 用户信息</a>
                        </li>
                        <li><a href="#"><i class="fa fa-gear fa-fw"></i> 设置</a>
                        </li>
                        <li class="divider"></li>
                        <li><a href="../logout"><i class="fa fa-sign-out fa-fw"></i> 退出</a>
                        </li>
                    </ul>
                    <!-- /.dropdown-user -->
                </li>
                <!-- /.dropdown -->
            </ul>
        </nav>

        <!--/. NAV TOP  -->
        <nav class="navbar-default navbar-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav" id="main-menu">
                    <li><a href="index.html" class="menu-hand"><i class="fa fa-sitemap"></i><span class="fa arrow"></span>首页</a></li>
                </ul>
            </div>
        </nav>
        <!-- /. NAV SIDE  内部内容从这里开始-->
        <div id="page-wrapper">
            <iframe scrolling="no" frameborder="0" id="home" src="home.html" style="height:1200px;" width="100%" height="100%"></iframe>
            <iframe scrolling="no" id="main" name="main" frameborder="0"   style="height:1200px;"  width="100%"  height="100%"  ></iframe>
        </div>
        <!-- /. PAGE WRAPPER  -->
    </div>
    <!-- /. WRAPPER  -->
    <!-- JS Scripts-->
    <!-- jQuery Js -->
    <script src="../assets/js/jquery-3.4.1.min.js"></script>
    <!-- Bootstrap Js -->
    <script src="../assets/js/bootstrap.min.js"></script>
    <!-- Metis Menu Js -->
    <script src="../assets/js/jquery.metisMenu.js"></script>
    <!-- Morris Chart Js -->
    <script src="../assets/js/morris/raphael-2.1.0.min.js"></script>
   <!-- <script src="../assets/js/morris/morris.js"></script>-->
    <!-- Custom Js -->
 <!--   <script src="../assets/js/custom-scripts.js"></script>-->
</body>

<script type="text/javascript">

   $(function () {
       getMenu();
   })

   function getMenu() {
       $.ajax({
           type:"get",
           url:"/permission/getPermissionByAccount",
           contentType:"application/json;charset=utf-8",
           success:function (resule) {
               var  head='';
               var  tail='';
               $.each(resule.flist,function (i,v) {
                   if(v.parentId=="0")
                   {
                       head='<li>'+ '<a  class="menu-hand"><i class="fa fa-sitemap"></i> '+v.description+'<span class="fa arrow"  ></span></a>'+'<ul class="nav nav-second-level "  >';
                       $.each(resule.zlist,function (i,b) {
                           if(v.permissionId===b.parentId)
                           {
                               tail +=  '<li>'+ '<a href="'+b.url+'" class="menu-id" target="main"  >'+b.description+'</a>'+ '</li>';
                           }
                       });
                   }
                   var end= '</ul>'+'</li>';
                   var js=head+tail+end;
                   $("#main-menu").append(js);
                   tail='';
               });
               $(".nav-second-level").hide();
               $(".menu-hand").click(function () {
                   $(this).siblings(".nav-second-level").slideToggle(500);
                   $(this).siblings(".menu-hand").removeClass('menu-hand');
               });
               $(".menu-id").click(function () {
                   $(this).siblings(".menu-id").removeClass('menu-id');
                   $('#home').remove();
               })
           }
       });
   }

</script>
</html>